<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge" ><![endif]-->
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Freshdesk Tickets Viewer</title>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<script type="text/javascript">
function start()
{
	var freshdeskDomain = document.getElementById('freshdeskDomain').value;

	if (freshdeskDomain.length == 0)
	{
		alert("Please enter a valid Freshdesk domain");

    return;
	}

  var freshdeskApiKey = document.getElementById('freshdeskApiKey').value;

  if (freshdeskApiKey.length == 0)
  {
  	alert("Please enter a valid Freshdesk API key");

    return;
  }

  window.open('https://www.draw.io/?ui=min&p=tickets#_TICKETS' + encodeURIComponent(JSON.stringify({
    ticketsConfig: {deskApiKey: freshdeskApiKey, deskDomain: freshdeskDomain}
  })));
}
</script>
</head>
<body onload="document.getElementById('freshdeskDomain').focus();">
  <h2>Freshdesk Tickets Viewer</h2>
  Drag and drop tickets from Freshdesk. Update tickets via Extras, Update Tickets.<br>
  To start the editor, enter your Freshdesk domain and API key below and click Start.
  <br><br>
  Freshdesk Domain: <input type="text" id="freshdeskDomain" size="12" value="" placeholder="example"></input>.freshdesk.com
  <br><br>
  Freshdesk API Key: <input type="password" id="freshdeskApiKey" size="20" value="" placeholder="See Profile Settings"></input>
  <br><br>
  <button onclick="start();return false;" style="font-weight:bold;font-size:15px;">Start</button>
  <br><br>
  Note: The API Key will be passed to draw.io using a location hash property, which is then removed from the address bar.
  Hash properties do not appear in server access logs and your API key is only used for communications between
  your browser and Freshdesk.
</body>
</html>
